
function initFeedback() {

	/*
	$("body").append('\
		<div class="feedback_container">\
			<div class="feedback_tab">Feedback...</div>\
			<div class="feedback_form">\
				<form>\
					From:<br />\
					<input id="feedback_from" type="text" name="feedback_from"><br />\
					Comment:<br />\
					<textarea id="feedback_comment" class="feedback" name="feedback_comment"></textarea><br />\
					<input type="button" value="Post" id="sendfeedback_button">\
				</form>\
			</div>\
		</div>\
	');
	*/
	
	$(".feedback_form").hide();
	$(".feedback_tab").click(function() {
		$(".feedback_form").slideToggle(500);
	});
	
	$("#sendfeedback_button").click(function() {
		
		$.post("http://random/~abel/prototypes/layoutTool/sendfeedback.php",
			{ doc_uuid: $("#doc_uuid").val(),
			  from: $("#feedback_from").val(),
			  comment: $("#feedback_comment").val() },
			function(data) {
				//alert("comment sent!");
				loadComments();
				$(".feedback_form").slideToggle(500);
				$("#feedback_from").val("");
				$("#feedback_comment").val("");
			}
		);
	});

}

function loadComments() {
	
	$.post("http://random/~abel/prototypes/layoutTool/getcomments.php",
		{ doc_uuid: $("#doc_uuid").val() },
		function(data) {
			//alert(data);
			$(".comments_container").empty();
			$(".comments_container").append(data);
		}
	);
	
}